<template>
  <el-row>
    <el-col :span="8" style="padding-right: 10px">
      <!-- <div class="grid-content bg-purple"> -->
      <el-card class="box-card">
        <div class="user">
          <img src="../assets/images/user.png" />
          <div class="userinfo">
            <p class="name">Admin</p>
            <p class="access">超级管理员</p>
          </div>
        </div>
        <div class="login-info">
          <p>上次登录时间: <span>2021-7-19</span></p>
          <p>上次登录地点: <span>武汉</span></p>
        </div>
      </el-card>
      <el-card style="margin-top: 20px">
        <!-- </div> -->
        <el-table :data="tableData" style="width: 100%">
          <el-table-column
            v-for="(val, key) in tableLabel"
            :prop="key"
            :label="val"
            :key="key"
          />
          <!-- <el-table-column prop="todayBuy" label="今日购买"> </el-table-column>
          <el-table-column prop="monthBuy" label="本月购买"> </el-table-column>
          <el-table-column prop="totalBuy" label="总购买"> </el-table-column> -->
        </el-table>
      </el-card>
    </el-col>
    <el-col :span="16" style="padding-left: 10px">
      <div class="num">
        <el-card
          v-for="item in countData"
          :key="item.name"
          :body-style="{ display: 'flex', padding: '0' }"
        >
          <i
            class="icon"
            :class="`el-icon-${item.icon}`"
            :style="{ background: item.color }"
          ></i>
          <div class="detail">
            <p class="price">¥{{ item.value }}</p>
            <p class="desc">{{ item.name }}</p>
          </div>
        </el-card>
      </div>
      <div class="praph">
        <el-card style="height: 240px">
          <div ref="echats2" style="height: 240px">
            <h2>今日待回访</h2>
            <!-- <span> 1</span> -->
          </div></el-card
        >
        <el-card style="height: 240px">
          <h2>今日已回访</h2>
          <!-- <span> 1</span> -->
        </el-card>
      </div>
    </el-col>
  </el-row>
</template>

<script>
// import { getData } from "../api";
// import * as echarts from "echarts";
export default {
  name: "MyHome",
  mounted() {
  },
  data() {
    return {
      tableData: [],
      tableLabel: {
        name: "帮扶类型",
        todayBuy: "今日帮扶",
        monthBuy: "本月帮扶",
        totalBuy: "总帮扶",
      },
      countData: [
        {
          name: "今日回访人数",
          value: 1234,
          icon: "success",
          color: "#2ec7c9",
        },
        {
          name: "今日待回访人数",
          value: 210,
          icon: "star-on",
          color: "#ffb980",
        },
        {
          name: "今日已回访人数",
          value: 1234,
          icon: "s-goods",
          color: "#5ab1ef",
        },
        {
          name: "本月回访人数",
          value: 1234,
          icon: "success",
          color: "#2ec7c9",
        },
        {
          name: "本月待回访",
          value: 210,
          icon: "star-on",
          color: "#ffb980",
        },
        {
          name: "本月已回访人数",
          value: 1234,
          icon: "s-goods",
          color: "#5ab1ef",
        },
      ],
    };
  },
};
</script>

<style lang="less" scoped>
.user {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #ccc;
  display: flex;
  align-items: center;
  img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-right: 40px;
  }
  .userinfo {
    .name {
      font-size: 32px;
      margin-bottom: 10px;
    }
    .access {
      color: #999;
    }
  }
}
.login-info {
  p {
    font-size: 14px;
    color: #999;
    line-height: 28px;
    span {
      margin-left: 60px;
      color: #666;
    }
  }
}
.num {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  .icon {
    width: 80px;
    height: 80px;
    font-size: 30px;
    color: #fff;
    line-height: 80px;
    text-align: center;
  }
  .detail {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 15px;
    .price {
      font-size: 30px;
      margin-bottom: 10px;
      line-height: 30px;
      height: 30px;
    }
    .desc {
      font-size: 14px;
      color: #999;
      text-align: center;
    }
  }
  .el-card {
    width: 32%;
    margin-bottom: 20px;
  }
}
.praph {
  display: flex;
  justify-content: space-between;
  .el-card {
    width: 48%;
    margin-top: 20px;
    h2 {
      text-align: center;
      font-size: 28px;
      color: #999;
    }
    span {
      text-align: center;
      line-height: 100px;
      display: block;
      width: 100px;
      height: 100px;
      border: 1px solid #ccc;
      border-radius: 50%;
      margin: 30px auto;
      color: orangered;
      font-size: 38px;
    }
  }
}
</style>
